<template>
    <el-container>
        <el-main>
            <el-form ref="updateForm" :model="updateForm" :rules="rules" label-width="100px">
                <el-form-item label="标题" prop="title">
                    <el-input v-model.trim="updateForm.title" placeholder="请输入标题" />
                </el-form-item>
                <el-form-item label="跳转链接" prop="url">
                    <el-input v-model.trim="updateForm.url" placeholder="请输入跳转连接" />
                </el-form-item>
                <el-form-item label="排序" prop="sort">
                    <el-input v-model.trim="updateForm.sort" />
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="doUpdate">保存</el-button>
                </el-form-item>
            </el-form>
        </el-main>
    </el-container>
</template>

<script>
import { update, goBack } from '@/chaos/functions/mixin/pushcrud';

export default {
    name: 'updateImagetext',
    mixins: [update, goBack],
    data() {
        const rules = {
            title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
            url: [
                { required: true, message: '请输入跳转链接', trigger: 'blur' }
            ],
            sort: [{ required: true, message: '请输入排序', trigger: 'blur' }]
        };
        return {
            domain: 'iya_info',
            indexPath: 'imagetext',
            rules
        };
    },
    created() {
        this.showUpdate();
    }
};
</script>

<style scoped>
.el-form {
    width: 500px;
}
</style>
